package com.itheima.health.dao;

import com.itheima.health.dto.OrderSettingDTO;
import com.itheima.health.pojo.OrderSetting;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface OrderSettingDao {
    /**
     * 根据日期设置人数
     * @param orderSetting
     */
    @Update("update t_order_setting set number = #{number} where orderDate = #{orderDate}")
    void editNumberByDate(OrderSetting orderSetting);

    /**
     * 查看预约情况
     * @param localDate
     */
    @Select("select * from t_order_setting where orderDate = #{localDate}")
    OrderSetting getOrderSettingByMonth(LocalDate localDate);

    /**
     *
     * @param orderSetting
     * @return
     */
    @Select("select * from t_order_setting where orderDate = #{orderDate}")
    OrderSetting selectByDate(OrderSetting orderSetting);

    @Insert("insert into t_order_setting (number,orderDate) value (#{number},#{orderDate}) ")
    void addNumberByDate(OrderSetting orderSetting);
}
